<?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
//use yii\bootstrap\ActiveForm;
?>
<!--
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="keywords" content="首页关键字" />
  <meta name="description" content="首页描述" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Cache-Control" content="no-cache" />
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=2.0" />
  <meta name="apple-mobile-web-app-capable" content="yes"/>
  
  <link rel="stylesheet" href="resources/css/weui/weui.min.css">
  <link rel="stylesheet" href="resources/css/main.min.css">
  <link rel="stylesheet" href="resources/css/man.min.css">
  
  <script src="resources/js/jquery-1.10.min.js"></script>
  <script src="resources/js/jquery.touchSwipe.min.js"></script>
  <script src="resources/js/frmwebm.min.js"></script>
  <title>场地资源填写</title>
</head>
<body style="background: #ebebeb none repeat scroll 0 0;">
-->
<?php $this->title = '场地资源填写' ?>

<?php $form = ActiveForm::begin([
    'id' => 'myform',
    'fieldConfig' => [
        //'template' => YII_DEBUG ? "{input}\n{error}" : "{input}",
        'template' => "{input}",
        'options' => ['tag' => false],
    ],
]); ?>

<?php echo $form->errorSummary($model); ?>

<div class="weui_form">
	<div style="width:100%;height:5px;"></div>
	<div class="weui_form_item">
		<label class="weui_form_label">场地区域<span style="color:red;"> *</span></label>
		<div class="weui_form_inputBox">

            <?php echo $form->field($model, 'parent_area_id')->dropDownList(\yii\helpers\ArrayHelper::map(
                \common\models\MktArea::find()->children()->all(),
                'id',
                'title'
            ), ['prompt'=>'选择区域...', 'id'=>'parent_area_id', 'class'=>'weui_form_input', 'style'=>'width:50%;color:#A5A5A5;']); ?>

            <?php echo $form->field($model, 'area_id')->label('商圈')->widget(\kartik\depdrop\DepDrop::classname(), [
                 'options' => ['id' => 'area_id', 'class'=>'weui_form_input', 'style'=>'width:50%;color:#A5A5A5;'],
                 'pluginOptions'=>[
                     'depends'=>['parent_area_id'],
                     'placeholder' => '选择商圈...',
                     'url' => Url::to(['area-subcat']),                     
                 ]
             ]); ?>

		</div>
	</div>
	<div class="weui_form_item">
		<label class="weui_form_label">场地类型<span style="color:red;"> *</span></label>
		<div class="weui_form_inputBox">
        <?php echo $form->field($model, 'room_type')->dropDownList(common\models\MktSourceRoom::getRoomTypeOption(), ['onchange'=>"change(this);", 'class'=>'weui_form_input', 'style'=>'width:100%;color:#A5A5A5;', 'placeholder' => '请选择场地类型']) ?>
		</div>
	</div>
	<div class="weui_form_item">
		<label class="weui_form_label">可容纳人数<span style="color:red;"> *</span></label>
		<div class="weui_form_inputBox">
            <?php echo $form->field($model, 'room_capacity_min')->dropDownList(common\models\MktSourceRoom::getCapacityMinOption(), ['onchange'=>"change(this);", 'class'=>'weui_form_input', 'style'=>'width:50%;color:#A5A5A5;', 'placeholder' => '可容纳人数']) ?>
            <?php echo $form->field($model, 'room_capacity_max')->dropDownList(common\models\MktSourceRoom::getCapacityMaxOption(), ['onchange'=>"change(this);", 'class'=>'weui_form_input', 'style'=>'width:50%;color:#A5A5A5;', 'placeholder' => '可容纳人数']) ?>

		</div>
	</div>
	<div style="width:100%;height:10px;"></div>
</div>

<div class="weui_msg">
	<div class="weui_opr_area">
		<p class="weui_btn_area">
		    <a id="mybutton" href="#" class="weui_btn weui_btn_warn">保存</a>

		</p>
	</div>
</div>
<?php ActiveForm::end(); ?>

<script type="text/javascript">
function change(self)
{
	var obj = $(self)[0];
	var index = obj.selectedIndex;
	if(index==0)
		obj.style.color="#A5A5A5";
	else
		obj.style.color="#000000";
}
$("#mybutton").click(function(e){

	var temp = document.getElementById("area_id");
	if( temp.value.length == 0)
	{
        frmwebm.prompt({
            title: "友情提示",
            content: '区域不能为空！'
        });
		temp.focus();
		return false;
	}

    $("#myform").submit();
});

</script>
<!--
</body>
</html>
-->
<?php
/*
			<select onchange="change(this);" class="weui_form_input" style="width:50%;color:#A5A5A5;" name="select2">
				<option selected>请选择可容纳最少人数</option>
				<option value="1">10人以下</option>
				<option value="2">10 - 30人</option>
			</select>
			<select onchange="change(this);" class="weui_form_input" style="width:50%;color:#A5A5A5;" name="select2">
				<option selected>请选择可容纳最多人数</option>
				<option value="1">10人以下</option>
				<option value="2">10 - 30人</option>
			</select>

*/